package dtrs.corba.utilities;


public class DtrsGeneralUtilities {
	
	
	public static boolean validStringOnlyNumber(String toValidate){	
		 

		if(toValidate.trim().equalsIgnoreCase("") || toValidate.isEmpty()){
			return false;
		}
		
		for (int i = 0; i < toValidate.length(); i++) {
	         //If we find a non-digit character we return false.
	         if (!Character.isDigit(toValidate.charAt(i))){	         	
	             return false;
	          }
	     }
		
		if( Integer.valueOf(toValidate) == 0){
			return false;
		}
		 
		 return true;
	}
	
	
	public static String convertOperationToString(int operationShow) 
	{
		if (operationShow == DtrsConstants.OPERATION_RESERVE)
			return "Reserve:";
		if(operationShow == DtrsConstants.OPERATION_CHECK_TICKETS_DISPO)
			return "Check:";
		if(operationShow == DtrsConstants.OPERATION_EXCHANGED_TICKETS){
			return "Exchange:";
		}
		if(operationShow == DtrsConstants.OPERATION_CANCEL_TICKETS){
			return "Cancel:";
		}
		
		return null;
	}

}
